package com.itkang.decorate;

/**
 * <p>
 * 场景:
 * </p>
 *
 * @author york yuan
 * @version 1.0
 * @since 15/7/8下午3:25
 */
public class Soy extends CondimentDecorator {
    //需要装饰的对象
    Beverage beverage ;

    public Soy(Beverage beverage) {
        this.beverage = beverage;
    }

    /**
     * 所有condiment的子类必须实现此方法
     *
     * @return
     */
    @Override
    public String getDescription() {
        return beverage.getDescription() +  "  +Soy";
    }

    /**
     * 抽象方法,用于子类继承,计算价格
     *
     * @return
     */
    @Override
    public double cost() {
        return 0.2+beverage.cost();
    }
}
